//
//  DWCVc.swift
//  GjCup
//
//  Created by abc on 2024/4/7.
//

import UIKit

class DWCVc: UIViewController {
    
    var titles = [String]()
    
    var block:((Int)->())?
    

    @IBOutlet weak var tView: UITableView!
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
extension DWCVc:UITableViewDelegate,UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return titles.count
    }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "DWListCellX", for: indexPath) as! DWListCell
        cell.tLab.text = titles[indexPath.row]
        return cell
        
    }
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        block?(indexPath.row)
        navigationController?.popViewController(animated: true)
    }
}
